import serve from "./config";

//挂载请求类型
const http={
	
}

function getData(url,params,methods){
	const config={
		method:methods,
		url:url
	}
	if(methods=="post"){
		params?config.data=params:'';
		
	}else{
		params?config.params=params:'';
	}

	return serve(config);
}

["get","put","delete","post"].forEach(item=>{
	http[item]=(api,data,item)=>getData(api,data,item)
})

export default http;
